<include file="Common:header" />
<body>
<!--面包屑导航 开始-->
<div class="crumb_warp">
    <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
    <i class="fa fa-home"></i> <a href="{:U(MODULE_NAME.'/Index/info')}">首页</a> &raquo; 网站配置
</div>
<!--面包屑导航 结束-->
<!--搜索结果页面 列表 开始-->
<div class="result_wrap">
    <!--快捷导航 开始-->
    <div class="result_title">
        <h3>网站配置管理</h3>
    </div>
    <div class="result_content">
        <div class="short_wrap">
            <a href="{:U(MODULE_NAME.'/Config/add')}"><i class="fa fa-plus"></i>添加网站配置</a>
            <a href="{:U(MODULE_NAME.'/Config/index')}"><i class="fa fa-refresh"></i>全部网站配置</a>
        </div>
    </div>
    <!--快捷导航 结束-->
</div>

<div class="result_wrap">
    <div class="result_content">
        <form action="{:U(MODULE_NAME.'/Config/report')}" method="post">
            <table class="list_tab">
                <tr>
                    <th class="tc" width="5%">排序</th>
                    <th class="tc" width="5%">ID</th>
                    <th class="tc"  width="10%">标题</th>
                    <th class="tc"  width="10%">名称</th>
                    <th>内容</th>
                    <th class="tc"  width="10%">操作</th>
                </tr>
                <foreach name="data" item="v">
                <tr>
                    <td class="tc">
                        <input type="text" name="ord[]" onchange="changeByconfig(this,{$v['conf_id']})" value="{$v.conf_order}">
                    </td>
                    <td class="tc">{$v.conf_id}</td>
                    <td class="tc">{$v.conf_title}</td>
                    <td class="tc">{$v.conf_name}</td>
                    <td>{$v._html}</td>
                    <td class="tc">
                        <a href="{:U(MODULE_NAME.'/Config/edit',array('conf_id'=>$v['conf_id']))}">修改</a>
                        <a href="javascript:;" onclick="delConfig({$v['conf_id']})">删除</a>
                    </td>
                </tr>
                </foreach>
            </table>
            <div style="display:block;text-align:center;padding-top: 20px;"> <input type="submit" value="提交"></div>
        </form>
    </div>
</div>
<!--搜索结果页面 列表 结束-->
<script>
    //异步排序修改
    function changeByconfig(obj,conf_id){
        var conf_order = $(obj).val();
        $.post('{:U(MODULE_NAME."/config/change")}',{'conf_order':conf_order,'conf_id':conf_id},function(data){
            if(data.status==0){
                layer.alert(data.info, {icon: 6});
            }else{
                layer.alert(data.info, {icon: 5});
            }
        });
    }

    //异步删除分类
    function delConfig(conf_id){
        //layer询问框
        layer.confirm('您确定要删除吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post('{:U(MODULE_NAME."/config/delete")}',{'conf_id':conf_id},function(data){
                if(data.status==0){
                    layer.msg(data.info);
                    location.href=location.href;
                }else{
                    layer.msg(data.info);
                }
            });
        });
    }
</script>
</body>
</html>